﻿using NUnit.Framework;
using NUnit.Framework.Constraints;

namespace Dgg.LearnYourTools.NUnit.C_Assertions.d_Chaining
{
	[TestFixture]
	public class _025_ConjuctionChaining
	{
		[Test]
		public void ConjunctionChain()
		{
			Constraint positiveEvenNaturalNumbersLessThan10Containing4 =
				new AllItemsConstraint(new LessThanOrEqualConstraint(10)) &
				new AllItemsConstraint(new PredicateConstraint<int>(i => i % 2 == 0)) &
				new AllItemsConstraint(new GreaterThanConstraint(0)) &
				new SomeItemsConstraint(new EqualConstraint(40));

			Assert.That(new[] { 2, 4, 6, 8 }, positiveEvenNaturalNumbersLessThan10Containing4);
		}
	}
}
